package org.bw.bookstore.common.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Entity;
import javax.persistence.Transient;
import java.io.Serializable;

/**
 *@program: wisdom_bookstore
 *@description: 订单商品实体类
 *@Author: 孙冬雪
 *@Date: 2020-10-22 09:50
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Entity
@TableName("tb_order_goods")
public class TbOrderGoods extends BaseEntity implements Serializable {

    /**
     * 订单商品名称
     *
     * @Author 孙冬雪
     * @Date 2020/10/21 14:40
     **/
    private String goodsName;

    /**
     * 订单商品单价
     *
     * @Author 孙冬雪
     * @Date 2020/10/21 14:41
     **/
    private Double goodsPrice;

    /**
     * 订单商品总价
     *
     * @Author 孙冬雪
     * @Date 2020/10/21 18:41
     **/
    private Double goodsTotalPrice;

    /**
     * 购买数量
     *
     * @Author 孙冬雪
     * @Date 2020/10/21 14:42
     **/
    private Integer buyNum;

    /**
     * 书籍详情
     *
     * @Date 2020/10/21 14:43
     **/
    private String bookDetailedCode;

    /**
     * 所属订单
     *
     * @Author 孙冬雪
     * @Date 2020/10/21 15:34
     **/
    private String OrderRecordCode;

    /**
     * 一个订单商品对应一个书籍详情
     *
     * @Author 孙冬雪
     * @Date 2020/10/21 15:34
     **/
    @TableField(exist = false)
    @Transient
    private TbBookDetailed bookDetailed;

    /**
     * 一个订单商品属于一个订单记录
     *
     * @Author 孙冬雪
     * @Date 2020/10/21 15:36
     **/
    @TableField(exist = false)
    @Transient
    private TbOrderRecord tbOrderRecord;

}
